package com.tiger.log.test;

import com.tiger.log.common.enums.Result;
import com.tiger.log.common.response.Response;
import com.tiger.log.core.parse.ProceedParse;
import org.springframework.stereotype.Component;

/**
 * @ClassName ProceedImpl
 * @Description TODO
 * @Author huxuehao
 **/
@Component
public class ProceedImpl implements ProceedParse {
    @Override
    public String userCodeByTokenParse(String token) {
        if (token.startsWith("xxx")) {
            return "12345678876534";
        } else {
            return "987654567876534";
        }
    }

    @Override
    public Result executeResultParse(Object response) {
        return (int)((Response) response).get("code") == 200 ? Result.SUCCESS : Result.FAIL;
    }

    @Override
    public String userCodeByKeywordParse(Object keyword) {
        return null;
    }
}
